{include file='common/head'}
<div style="overflow-x: hidden;width: 96%;margin: auto;padding-top: 1rem;">


    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
    </fieldset>
    <ul class="layui-timeline">
        <li class="layui-timeline-item">
            <i class="layui-icon layui-timeline-axis"></i>
            <div class="layui-timeline-content layui-text">
                <h3 class="layui-timeline-title">保单险种

                </h3>
                <p>
                    <input type="hidden" value="{$res.i_id}" id="i_id">
                    <br>报案号 : {$info.policy_num | default=''}<br>
                    <br>保单号 : {$info.report_num | default=''}<br>
                    <br>出险险种 : {foreach($info.insurant_type_name as $k=>$v)}-{$v | default=''}-{/foreach}<br>
                </p>

            </div>
        </li>
        <li class="layui-timeline-item">
            <i class="layui-icon layui-timeline-axis"></i>
            <div class="layui-timeline-content layui-text">
                <h3 class="layui-timeline-title">参与竞价
                    {if($res.status == 2)}
                    <span style="margin-left: 20px;"><button class="layui-btn  layui-btn-xs return"  data="join_price">驳回</button></span>
                    {/if}
                    {if($res.status == 3)}
                    <span style="margin-left: 20px;"><button class="layui-btn layui-btn-danger layui-btn-xs return_msg" data="join_price">再次驳回</button></span>
                    {/if}
                </h3>
                <p>
                    <br> 本人是否参与竞价拍卖：{if(isset($res.is_join))}{if($res.is_join == 1)}参与{else}不参与{/if}{/if}<br>
                    <br>参与竞价拍卖需交纳保证金：{if(isset($res.is_join))}{if($res.is_promise == 1)}申请缴纳保证金{else}缴纳保证金{/if}{/if}<br>
                    <br>优先回购价格（总价）：{$res.back_price |default = ''} 元<br>
                </p>

                {if(isset($res))}
                {if($res.status == 3)}
                <p style="color: red">
                    {if(isset($data['join_price']))}
                    {foreach($data['join_price'] as $k=>$v)}
                    <br>{$v}<br>
                    {/foreach}
                    {/if}
                </p>
                {/if}
                {/if}
            </div>
        </li>
        <li class="layui-timeline-item">
            <i class="layui-icon layui-timeline-axis"></i>
            <div class="layui-timeline-content layui-text">
                <h3 class="layui-timeline-title">看货信息
                    {if($res.status == 2)}
                    <span style="margin-left: 20px;"><button class="layui-btn  layui-btn-xs return"  data="look_goods_info">驳回</button></span>
                    {/if}
                    {if($res.status == 3)}
                    <span style="margin-left: 20px;"><button class="layui-btn layui-btn-danger layui-btn-xs return_msg"  data="look_goods_info">再次驳回</button></span>
                    {/if}
                </h3>
                <p>
                    <br> 看货要求：{if(isset($res.look_type))}{if($res.look_type == 1)}预约联系{elseif($res.look_type ==2)}随时看货{elseif($res.look_type ==3)}交纳保证金后看货{/if}{/if}<br>
                    <br>看货地址 : {$res.province |default = ''}{$res.city |default = ''}{$res.town |default = ''}{$res.address_detail |default = ''}<br>
                    <br> 联系人：{$res.linkman |default = ''}<br>
                    <br>手机号：{$res.phone |default = ''}<br>
                    <br>备用联系人：{$res.second_phone |default = ''}<br>
                </p>
                {if(isset($res))}
                {if($res.status == 3)}
                <p style="color: red">
                    {if(isset($data['look_goods_info']))}
                    {foreach($data['look_goods_info'] as $k=>$v)}
                    <br>{$v}<br>
                    {/foreach}
                    {/if}
                </p>
                {/if}
                {/if}
            </div>
        </li>
        <li class="layui-timeline-item">
            <i class="layui-icon layui-timeline-axis"></i>
            <div class="layui-timeline-content layui-text">
                <h3 class="layui-timeline-title">提货信息
                    {if($res.status == 2)}
                    <span style="margin-left: 20px;"><button class="layui-btn  layui-btn-xs return"  data="bol_info">驳回</button></span>
                    {/if}
                    {if($res.status == 3)}
                    <span style="margin-left: 20px;"><button class="layui-btn layui-btn-danger layui-btn-xs return_msg"  data="bol_info">再次驳回</button></span>
                    {/if}
                </h3>
                <p>
                    <br>提货是否需要支付其他费用：{if(isset($res.is_pay))}{if($res.is_pay == 1)}是{/if}{if($res.is_pay == 2)}否{/if}{/if}<br>
                    <br>理由 : {$res.pay_result |default = ''}<br>
                    <br>  提货详细说明：{$res.bol_info |default = ''}<br>
                    <br>看货地址 : {$res.bol_province |default = ''}{$res.bol_city |default = ''}{$res.bol_town |default = ''}{$res.bol_address_detail |default = ''}<br>
                    <br>
                    联系人：{$res.bol_linkman |default = ''}
                    <br>
                    <br>手机号：{$res.bol_phone |default = ''} <br>
                    <br>提货时限：竞价拍卖后{$res.bol_days |default = ''} 天内提货<br>
                </p>
                {if(isset($res))}
                {if($res.status == 3)}
                <p style="color: red">
                    {if(isset($data['bol_info']))}
                    {foreach($data['bol_info'] as $k=>$v)}
                    <br>{$v}<br>
                    {/foreach}
                    {/if}
                </p>
                {/if}
                {/if}

            </div>
        </li>
        <li class="layui-timeline-item">
            <i class="layui-icon layui-timeline-axis"></i>
            <div class="layui-timeline-content layui-text">
                <h3 class="layui-timeline-title">收款信息
                    {if($res.status == 2)}
                    <span style="margin-left: 20px;"><button class="layui-btn  layui-btn-xs return"  data="receive_money">驳回</button></span>
                    {/if}
                    {if($res.status == 3)}
                    <span style="margin-left: 20px;"><button class="layui-btn layui-btn-danger layui-btn-xs return_msg"  data="receive_money">再次驳回</button></span>
                    {/if}
                </h3>
                <p>
                    <br>  您的收款名称：{$res.pay_name |default = ''}<br>
                    <br>开户银行：{$res.bank_name |default = ''}<br>
                    <br>账号：{$res.card_num |default = ''}<br>
                    <br> 税号：{$res.tax_num |default = ''}<br>
                    <br>地址：{$res.company_address |default = ''}<br>
                </p>
                {if(isset($res))}
                {if($res.status == 3)}
                <p style="color: red">
                    {if(isset($data['receive_money']))}
                    {foreach($data['receive_money'] as $k=>$v)}
                    <br>{$v}<br>
                    {/foreach}
                    {/if}
                </p>
                {/if}
                {/if}
            </div>
        </li>

        <li class="layui-timeline-item">
            <i class="layui-icon layui-timeline-axis"></i>
            <div class="layui-timeline-content layui-text">
                <h3 class="layui-timeline-title">授权书
                    {if($res.status == 2)}
                    <span style="margin-left: 20px;"><button class="layui-btn  layui-btn-xs return"  data="auth_report">驳回</button></span>
                    {/if}
                    {if($res.status == 3)}
                    <span style="margin-left: 20px;"><button class="layui-btn layui-btn-danger layui-btn-xs return_msg"  data="auth_report">再次驳回</button></span>
                    {/if}
                </h3>
                <p>
                    <br>授权书 :
                    {if(isset($res.entrust_url))}
                    {foreach($res.entrust_url as $v)}
                    <img src="{$v| default=''}" style="height: 100px;">
                    {/foreach}
                    {/if}
                    <br>
                </p>
                {if(isset($res))}
                {if($res.status == 3)}
                <p style="color: red">
                    {if(isset($data['auth_report']))}
                    {foreach($data['auth_report'] as $k=>$v)}
                    <br>{$v}<br>
                    {/foreach}
                    {/if}
                </p>
                {/if}
                {/if}
            </div>
        </li>
    </ul>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">

    </fieldset>
</div>
{include file='common/footer'}
<script>

    layui.use('layedit', function(){
        var layedit = layui.layedit;
        layedit.set({
            uploadImage: {
                url: '{:url("Upload/file_content")}' //接口url
                ,type: 'post' //默认post
            }
        });
        //注意：layedit.set 一定要放在 build 前面，否则配置全局接口将无效。
    });

</script>


<script>
    layui.use(['form', 'layedit', 'laydate'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate;

        //日期
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //创建一个编辑器
        var editIndex = layedit.build('demo');

        //自定义验证规则
        form.verify({
            pass: [/(.+){6,12}$/, '密码必须6到12位']
            ,content: function(value){
                layedit.sync(editIndex);
            }
        });

        //监听指定开关
        form.on('switch(switchTest)', function(data){
            layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
                offset: '6px'
            });
            layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
        });

        $('.return').click(function () {
            var i_id = $('#i_id').val();
            var key = $(this).attr('data');
            layer.open({
                type: 2,
                title: '添加驳回信息',
                shadeClose: true,
                shade: false,
                maxmin: true,
                area: ['893px', '400px'],
                content: '{:url("InsurantMan/save_return")}?i_id='+i_id+'&key='+key,
                end: function () {
                    table.reload('testReload');
                },
            });
        });


        $('.return_msg').click(function () {
            var i_id = $('#i_id').val();
            var key = $(this).attr('data');
            layer.open({
                type: 2,
                title: '添加驳回信息',
                shadeClose: true,
                shade: false,
                maxmin: true,
                area: ['893px', '400px'],
                content: '{:url("InsurantMan/save_return")}?i_id='+i_id+'&key='+key,
                end: function () {
                    table.reload('testReload');
                },
            });
        });



        //监听提交
        form.on('submit(demo1)', function(data){
            $.ajax({
                url: '{:url("User/saveUserInfo")}',
                type: 'post',
                dataType: 'json',
                data: data.field,
                success: function (obj) {
                    if(obj.code==200){
                        parent.layer.msg(obj.msg, {icon: 6,time: 1000});
                        //当你在iframe页面关闭自身时
                        var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                        parent.layer.close(index,data.field); //再执行关闭
                    }
                    if(obj.code==500){
                        layer.msg(obj.msg, {icon: 5,time: 1000});
                    }
                },
                error:function(data){
                    console.log(data);
                }
            });

        });


    });
</script>

</body>
</html>